package com.syg.servlet14_Session;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
@WebServlet("/sessionIsNull")
public class _01_Session extends HttpServlet {
    private int Thread_Count=0;
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        HttpSession session = req.getSession();
//        String str = (String)session.getAttribute("ValidateSMSNum");
//        if(str==null){
//            System.out.println("shenyiguangsessionIsNull");
//        }else if("null".equals(str)){
//            System.out.println("shenyiguangsessionIsNotNull");
//        }
        session.removeAttribute("haha");
        ++Thread_Count;
        System.out.println("被调用的次数"+Thread_Count);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
